#include<bits/stdc++.h>
using namespace std;
int n,t,k,ys;
int a[100010];
int b[100010];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    int ans=n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    k=a[1];
    t=1;
    for(int i=1;i<=n;i++)
    {
        if(k>=a[i])
        {
            t++;
            b[t]++;
            k=a[i];
        }else{
        b[t]++;
        }
    }
    ys=b[1];
    for(int i=2;i<=t;i++)
    {
        if(ys<=b[i])
        {
            ans=ans-ys;
            ys=b[i];
        }else
        {
            ans=ans-b[i];
        }
    }
    cout<<ans;

}
